package com.ruoyi.bizsys.service.impl;

import java.util.List;
import java.util.Arrays;
                                                                                                                                            import com.ruoyi.common.utils.DateUtils;
            import org.springframework.stereotype.Service;
    import com.ruoyi.bizsys.mapper.MarketCustStatusSyncLogMapper;
import com.ruoyi.bizsys.domain.MarketCustStatusSyncLog;
import com.ruoyi.bizsys.service.IMarketCustStatusSyncLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;


/**
 * 营销客户状态同步日志Service业务层处理
 *
 * @author african-loan
 * @date 2021-10-28
 */
@Service
public class MarketCustStatusSyncLogServiceImpl extends ServiceImpl<MarketCustStatusSyncLogMapper,MarketCustStatusSyncLog> implements IMarketCustStatusSyncLogService {

    /**
     * 查询营销客户状态同步日志
     *
     * @param id 营销客户状态同步日志ID
     * @return 营销客户状态同步日志
     */
    @Override
    public MarketCustStatusSyncLog selectMarketCustStatusSyncLogById(Long id) {
        return this.getById(id);
    }

    /**
     * 查询营销客户状态同步日志列表
     *
     * @param marketCustStatusSyncLog 营销客户状态同步日志
     * @return 营销客户状态同步日志
     */
    @Override
    public List<MarketCustStatusSyncLog> selectMarketCustStatusSyncLogList(MarketCustStatusSyncLog marketCustStatusSyncLog) {
        return this.list(new QueryWrapper<>(marketCustStatusSyncLog).last("order by id desc"));
    }

    /**
     * 新增营销客户状态同步日志
     *
     * @param marketCustStatusSyncLog 营销客户状态同步日志
     * @return 结果
     */
            @Override
    public int insertMarketCustStatusSyncLog(MarketCustStatusSyncLog marketCustStatusSyncLog) {
                                                                                                                                                                                                                                            marketCustStatusSyncLog.setCreateTime(DateUtils.getNowDate());
                                                                    return baseMapper.insert(marketCustStatusSyncLog);
    }

    /**
     * 修改营销客户状态同步日志
     *
     * @param marketCustStatusSyncLog 营销客户状态同步日志
     * @return 结果
     */
            @Override
    public int updateMarketCustStatusSyncLog(MarketCustStatusSyncLog marketCustStatusSyncLog) {
                                                                                                                                                                                                                                                                                    marketCustStatusSyncLog.setUpdateTime(DateUtils.getNowDate());
                            return baseMapper.updateById(marketCustStatusSyncLog);
    }

    /**
     * 批量删除营销客户状态同步日志
     *
     * @param ids 需要删除的营销客户状态同步日志ID
     * @return 结果
     */
            @Override
    public int deleteMarketCustStatusSyncLogByIds(Long[] ids) {
        return baseMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除营销客户状态同步日志信息
     *
     * @param id 营销客户状态同步日志ID
     * @return 结果
     */
    @Override
    public int deleteMarketCustStatusSyncLogById(Long id) {
        return baseMapper.deleteById(id);
    }

}
